<template>
  <div class="BaseTitle">
    <div class="left baseSMTitle" :class="titleRed ? 'titleRed' : ''">
      {{ title }}
      <div class="titleSmall" v-if="titleSmall">{{titleSmall}}</div>
    </div>
    <div class="right" v-if="isRight">
      <span @click="goMore()">{{ more }}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
    },
    more: {
      type: String,
    },
    isRight: {
      type: Boolean,
      default: false,
    },
    titleRed: {
      type: Boolean,
      default: false,
    },
    titleSmall: {
      type: String,
    },
  },
  methods: {
    goMore() {
      this.$emit("goMore");
    },
  },
};
</script>

<style scoped lang="less">
.BaseTitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30rpx 20rpx;
  box-sizing: border-box;
  .titleSmall {
    font-family: MicrosoftYaHei;
    font-size: 20rpx;
    font-weight: normal;
    font-stretch: normal;
    letter-spacing: 0rpx;
    color: #999999;
  }

  .right {
    span {
      font-family: MicrosoftYaHei;
      font-size: 24rpx;
      font-weight: normal;
      font-stretch: normal;
      line-height: 36rpx;
      letter-spacing: 0rpx;
      color: #282828;
    }
  }
}

.titleRed {
  padding-left: 30rpx;
  position: relative;
}
.titleRed::before {
  content: "";
  position: absolute;
  width: 11rpx;
  height: 29rpx;
  background-color: #d81e06;
  border-radius: 6rpx;
  left: 0;
  top: 6rpx;
}
</style>